Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[admin] Separate authorization from authentication #5390

Merged
merged 3 commits into from
Sep 21, 2023

Conversation

elia
Copy link
Member

@elia elia commented Sep 20, 2023

Summary

This PR disambiguates "auth" pulling "authorization" management out of the Spree::Backend adapter into its own module that is not tied to the authentication implementation of choice.

This makes the authentication backend adapter for SolidusAdmin have a slightly different behavior from the original one, but it should match when using the standard solidus_auth_devise (by default it requires authentication if authorization fails and no user is authenticated).

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #5390 (3dbae49) into nebulab/admin (7f55370) will increase coverage by 0.00%.
The diff coverage is 90.90%.

@@              Coverage Diff               @@
##           nebulab/admin    #5390   +/-   ##
==============================================
  Coverage          88.78%   88.79%           
==============================================
  Files                606      607    +1     
  Lines              14670    14680   +10     
==============================================
+ Hits               13025    13035   +10     
  Misses              1645     1645           
Files Changed Coverage Δ
...s/solidus_admin/authentication_adapters/backend.rb 84.61% <84.61%> (ø)
.../solidus_admin/controller_helpers/authorization.rb 92.85% <92.85%> (ø)
...p/controllers/solidus_admin/accounts_controller.rb 100.00% <100.00%> (ø)
...n/app/controllers/solidus_admin/base_controller.rb 100.00% <100.00%> (ø)
...solidus_admin/controller_helpers/authentication.rb 100.00% <100.00%> (ø)
admin/lib/solidus_admin/preview.rb 93.33% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@elia elia marked this pull request as ready for review September 20, 2023 15:01
@elia elia requested a review from a team as a code owner September 20, 2023 15:01
@elia elia requested a review from rainerdema September 20, 2023 15:15
Copy link
Contributor

@rainerdema rainerdema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@elia elia merged commit 64b4c8e into nebulab/admin Sep 21, 2023
4 checks passed
@elia elia deleted the elia/admin/authorization branch September 21, 2023 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants